package com.joysuch.wwyt.workflow.bean;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author ZhangDong
 * @Date 2021/1/8 10:10
 */
@Data
public class ScreenColumnConfigBean {

    @ApiModelProperty("主键ID")
    private Long id;
    @ApiModelProperty("专栏类型id")
    private Long typeId;
    @ApiModelProperty("专栏类型名称")
    private String typeName;
    @ApiModelProperty("配置信息")
    private List<ScreenColumnConfigDetailBean> detail;

//    @ApiModelProperty("重大危险源")
//    private boolean dangerSource;
//    @ApiModelProperty("风险区域")
//    private boolean dangerAreas;
//    @ApiModelProperty("设备装置")
//    private boolean device;
//    @ApiModelProperty("监控探头")
//    private boolean cameras;
//    @ApiModelProperty("人员")
//    private boolean persons;
//    @ApiModelProperty("车辆")
//    private boolean car;
//    @ApiModelProperty("作业证")
//    private boolean specialWork;
//    @ApiModelProperty("有毒气体")
//    private boolean harmfulGas;
//    @ApiModelProperty("可燃气体")
//    private boolean easyFireGas;
//    @ApiModelProperty("仓库物资")
//    private boolean storeMaterials;

    public ScreenColumnConfigBean() {
        detail = new ArrayList<>(10);
        detail.add(new ScreenColumnConfigDetailBean("重大危险源", "dangerSource", false, false));
        detail.add(new ScreenColumnConfigDetailBean("风险区域", "dangerAreas", false, false));
        detail.add(new ScreenColumnConfigDetailBean("设备装置", "device", false, false));
        detail.add(new ScreenColumnConfigDetailBean("监控探头", "cameras", false, false));
        detail.add(new ScreenColumnConfigDetailBean("人员", "persons", false, false));
        detail.add(new ScreenColumnConfigDetailBean("车辆", "car", false, false));
        detail.add(new ScreenColumnConfigDetailBean("作业证", "specialWork", false, false));
        detail.add(new ScreenColumnConfigDetailBean("有毒气体", "harmfulGas", true, true));
        detail.add(new ScreenColumnConfigDetailBean("可燃气体", "easyFireGas", true, true));
        detail.add(new ScreenColumnConfigDetailBean("仓库物资", "storeMaterials", false, false));
    }

    /**
     * 各个模块想要有默认配置
     */
    public ScreenColumnConfigBean(String typeName) {
        detail = new ArrayList<>(10);
        if ("重大危险源".equals(typeName)) {
            detail.add(new ScreenColumnConfigDetailBean("重大危险源", true, "dangerSource", false, false));
            detail.add(new ScreenColumnConfigDetailBean("风险区域", "dangerAreas", false, false));
            detail.add(new ScreenColumnConfigDetailBean("设备装置", true, "device", false, false));
            detail.add(new ScreenColumnConfigDetailBean("监控探头", true, "cameras", false, false));
            detail.add(new ScreenColumnConfigDetailBean("人员", "persons", false, false));
            detail.add(new ScreenColumnConfigDetailBean("车辆", "car", false, false));
            detail.add(new ScreenColumnConfigDetailBean("作业证", "specialWork", false, false));
            detail.add(new ScreenColumnConfigDetailBean("有毒气体", true, "harmfulGas", true, true));
            detail.add(new ScreenColumnConfigDetailBean("可燃气体", true, "easyFireGas", true, true));
            detail.add(new ScreenColumnConfigDetailBean("仓库物资", "storeMaterials", false, false));
            detail.add(new ScreenColumnConfigDetailBean("报警", true, "alarm", false, false));
        } else if ("风险四色图".equals(typeName)) {
            detail.add(new ScreenColumnConfigDetailBean("重大危险源", "dangerSource", false, false));
            detail.add(new ScreenColumnConfigDetailBean("风险区域", true, "dangerAreas", false, false));
            detail.add(new ScreenColumnConfigDetailBean("设备装置", "device", false, false));
            detail.add(new ScreenColumnConfigDetailBean("监控探头", "cameras", false, false));
            detail.add(new ScreenColumnConfigDetailBean("人员", "persons", false, false));
            detail.add(new ScreenColumnConfigDetailBean("车辆", "car", false, false));
            detail.add(new ScreenColumnConfigDetailBean("作业证", true, "specialWork", false, false));
            detail.add(new ScreenColumnConfigDetailBean("有毒气体", "harmfulGas", true, true));
            detail.add(new ScreenColumnConfigDetailBean("可燃气体", "easyFireGas", true, true));
            detail.add(new ScreenColumnConfigDetailBean("仓库物资", "storeMaterials", false, false));
            detail.add(new ScreenColumnConfigDetailBean("报警", true, "alarm", false, false));
        } else if ("人车管控".equals(typeName) || "作业票".equals(typeName)) {
            detail.add(new ScreenColumnConfigDetailBean("重大危险源", "dangerSource", false, false));
            detail.add(new ScreenColumnConfigDetailBean("风险区域", "dangerAreas", false, false));
            detail.add(new ScreenColumnConfigDetailBean("设备装置", "device", false, false));
            detail.add(new ScreenColumnConfigDetailBean("监控探头", "cameras", false, false));
            detail.add(new ScreenColumnConfigDetailBean("人员", true, "persons", false, false));
            detail.add(new ScreenColumnConfigDetailBean("车辆", true, "car", false, false));
            detail.add(new ScreenColumnConfigDetailBean("作业证", true, "specialWork", false, false));
            detail.add(new ScreenColumnConfigDetailBean("有毒气体", "harmfulGas", true, true));
            detail.add(new ScreenColumnConfigDetailBean("可燃气体", "easyFireGas", true, true));
            detail.add(new ScreenColumnConfigDetailBean("仓库物资", "storeMaterials", false, false));
            detail.add(new ScreenColumnConfigDetailBean("报警", true, "alarm", false, false));
        } else {
            detail.add(new ScreenColumnConfigDetailBean("重大危险源", "dangerSource", false, false));
            detail.add(new ScreenColumnConfigDetailBean("风险区域", "dangerAreas", false, false));
            detail.add(new ScreenColumnConfigDetailBean("设备装置", "device", false, false));
            detail.add(new ScreenColumnConfigDetailBean("监控探头", "cameras", false, false));
            detail.add(new ScreenColumnConfigDetailBean("人员", "persons", false, false));
            detail.add(new ScreenColumnConfigDetailBean("车辆", "car", false, false));
            detail.add(new ScreenColumnConfigDetailBean("作业证", "specialWork", false, false));
            detail.add(new ScreenColumnConfigDetailBean("有毒气体", "harmfulGas", true, true));
            detail.add(new ScreenColumnConfigDetailBean("可燃气体", "easyFireGas", true, true));
            detail.add(new ScreenColumnConfigDetailBean("仓库物资", "storeMaterials", false, false));
            detail.add(new ScreenColumnConfigDetailBean("报警", "alarm", false, false));
        }

    }

}
